#=========================
# 定义开头
#=========================
#------- documentclass ------------------
#默认是指定纸张为 A4 大小,基本字号为 10pt,双面排版
snippet xeda "docmentclass"
\documentclass${1:[UTF8,10pt,twoside,a4paper]}{ctexart}
${0}
endsnippet

#默认是指定纸张为 A4 大小,基本字号为 10pt(5号字),双面排版
snippet doca "docmentclass"
\documentclass${1:[10pt,twoside,a4paper]}{article}
${0}
endsnippet

snippet docr "docmentclass"
\documentclass{report}
endsnippet

snippet docb "docmentclass"
\documentclass{book}
endsnippet

#------- package -----------------
snippet upa "describe"
\usepackage{${1:package-name}}
${0}
endsnippet

#------- begin -------------------------
snippet beg "describe"
\begin{$1}
${0}
\end{$1}
endsnippet

snippet aut "author"
\author{${1:<++>}}
${0}
endsnippet

snippet tit "describe"
\title{${1:<++>}}
\maketitle
${0}
endsnippet

snippet ctex "引入中文包"
\usepackage{ctex}  
endsnippet




#============================================
#---------- 行间距 ----------------
snippet lspread "describe"
\linespread{${1:1}} %调整行间距
${0}
endsnippet

#==============================================
#---------- 

snippet today "Date"
`date +%F`
endsnippet

snippet box "Box"
`!p snip.rv = '┌' + '─' * (len(t[1]) + 2) + '┐'`
│ $1 │
`!p snip.rv = '└' + '─' * (len(t[1]) + 2) + '┘'`
$0
endsnippet

#自动加上下标
# snippet '([A-Za-z])(\d)' "auto subscript" wrA
# `!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)`
# endsnippet
# 
# snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA
# `!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`}
# endsnippet


snippet mk "Math" wA
$${1}$$0
endsnippet

snippet dm "Math" wA
\[
$1
\] $0
endsnippet


snippet // "describe"
\frac{$1}{$2}$0
endsnippet

#snippet '((\d+)|(\d*)(\\)?([A-Za-z]+)((\^|_)(\{\d+\}|\d))*)/' "Fraction" wrA
#\\frac{`!p snip.rv = match.group(1)`}{$1}$0
#endsnippet

#snippet / "Fraction" iA
#\\frac{${VISUAL}}{$1}$0
#endsnippet

# YBXstyle.cls
snippet blte "blue text"
\\textcolor{blue}{\\textbf{${1:text}}}$0
endsnippet

snippet redte "red text"
\\textcolor{red}{\\textbf{${1:text}}}$0
endsnippet

snippet Purte "YBXPurple text"
\\textcolor{YBXPurple}{${1:text}}$0
endsnippet

snippet yelback "yellow background"
\\colorbox{yellow}{\\color{black}{${1:text}}}$0
endsnippet

snippet enum "enumerate with itemindent"
\\begin{enumerate}[${1:itemindent=1em},${2:label=\\arabic*)}]
		\\item ${3:item}
\\end{enumerate}
$0
endsnippet

snippet fig "figure"
\\begin{figure}[htpb]
		\\centering
		\\includegraphics[width=${1:0.8}\\textwidth]{${2:figure}}
		\\caption{${3:caption}}
		\\label{fig:${4:label}}
\\end{figure}
$0
endsnippet

snippet der "derivation"
\\begin{derivation}{${1:推导}}
		${2:推导过程}
\\end{derivation}
$0
endsnippet

snippet example "example"
\\begin{example}
		\\exProblem
		${1:问题}
		
		\\exSolution
		${2:解答}
\\end{example}
$0
endsnippet

snippet Thm "Thm"
\\begin{Thm}[${1:定理名称}]
		${2:定理内容}
\\end{Thm}
$0
endsnippet

snippet Def "Def"
\\begin{Def}[${1:定理名称}]
		${2:定理内容}
\\end{Def}
$0
endsnippet

snippet Tips "Tips"
\\begin{Tips}[${1:定理名称}]
		${2:定理内容}
\\end{Tips}
$0
endsnippet










